﻿<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
            + path + "/";
%>
<!DOCTYPE html>
<html lang="en">
<head>
    <base href="<%=basePath%>">
    <%@ include file="../system/admin/top.jsp" %>
    <!-- jsp文件头和头部 -->
    <script src='static/js/jquery-1.9.1.min.js'></script>
    <script type="text/javascript" src="static/js/layer.js"></script>
    <link rel="stylesheet" href="static/css/ace.min.css"/>
    <link rel="stylesheet" href="static/css/ace-responsive.min.css"/>
    <link rel="stylesheet" href="static/css/ace-skins.min.css"/>
    <script type="text/javascript"
            src="static/js/My97DatePicker/WdatePicker.js"></script>
    <link rel="stylesheet" href="static/css/layui.css" media="all">
    <script src='static/js/commonJs.js${getTime}'></script>
    <script type="text/javascript" src="static/js/jquery.tips.js"></script>
    <script>
    </script>
    <style>
        .divcss5 {
            width: 100px;
            height: 20px;
        }
    </style>
</head>
<body>
<br>
<div style="width: 2000px">
    <form action="<%=basePath%>general/view/resultList.do" method="post"
          name="pageForm" id="pageForm">
        <!-- 组合查询 -->
        <table>
            <tr>
                <td>
                    <div class="pull-left search " style="text-align: center;margin-left: 20px;">
                        借款产品:
                        <select id="productSource" class="chzn-select form-control" name="productSource"
                                data-placeholder="不限"
                                style="font-size: 15px;padding: 2px 3px;color: #000;width: 100px;">
                            <option value=""></option>
                            <option value="">请选择</option>
                            <option value="2"
                                    <c:if test="${pd.productSource=='2'}">selected</c:if>>今日现金
                            </option>
                            <option value="6"
                                    <c:if test="${pd.productSource=='6'}">selected</c:if> >卡贷
                            </option>
                            <option value="39"
                                    <c:if test="${'39' eq pd.productSource}">selected</c:if> >融360
                            </option>
                            <option value="41"
                                    <c:if test="${'41' eq pd.productSource}">selected</c:if> >消费分期
                            </option>
                            <option value="43"
                                    <c:if test="${'43' eq pd.productSource}">selected</c:if> >游戏贷
                            </option>
                            <option value="8"
                                    <c:if test="${'8' eq pd.productSource}">selected</c:if> >教育分期
                            </option>
                            <option value="45"
                                    <c:if test="${'45' eq pd.productSource}">selected</c:if> >游戏贷融360
                            </option>
                        </select>
                    </div>
                </td>
                <td>
                    <div class="pull-left search " style="text-align: center;margin-left: 20px;">
                        入案时间:
                        <input type="text" id="minCreateTime" name="minCreateTime" class="form-control divcss5"
                               onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})" class="Wdate"
                               value="${pd.minCreateTime}"/>至
                        <input type="text" id="maxCreateTime" name="maxCreateTime" class="form-control divcss5"
                               onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})" class="Wdate"
                               value="${pd.maxCreateTime}"/>
                    </div>
                </td>
                <td>
                    <div class="pull-left search " style="text-align: center;margin-left: 20px;">
                        分派时间:
                        <input type="text" id="minCallTime" name="minCallTime" class="form-control divcss5"
                               onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})" class="Wdate"
                               value="${pd.minCallTime}"/>至
                        <input type="text" id="maxCallTime" name="maxCallTime" class="form-control divcss5"
                               onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})" class="Wdate"
                               value="${pd.maxCallTime}"/>
                    </div>
                </td>
                <td>
                    <div class="pull-left search " style="text-align: center;margin-left: 20px;">
                        结案时间:
                        <input type="text" id="minEndCaseDateOver" name="minEndCaseDateOver"
                               class="form-control divcss5"
                               onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})" class="Wdate"
                               value="${pd.minEndCaseDateOver}"/>至
                        <input type="text" id="maxEndCaseDateOver" name="maxEndCaseDateOver"
                               class="form-control divcss5"
                               onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})" class="Wdate"
                               value="${pd.maxEndCaseDateOver}"/>
                    </div>
                </td>
            </tr>
            <tr>
                <td>
                    <div class="pull-left search " style="text-align: center;margin-left: 20px;">
                        逾期阶段:
                        <select
                                class="chzn-select form-control" id="overdueStage" name="overdueStage"
                                data-placeholder="不限"
                                style="font-size: 15px;padding: 2px 3px;color: #000;width: 100px;">
                            <option value=""></option>
                            <option value="">不限</option>
                            <option value="S1"
                                    <c:if test="${pd.overdueStage=='S1'}">selected</c:if>>S1
                            </option>
                            <option value="S2"
                                    <c:if test="${pd.overdueStage=='S2'}">selected</c:if>>S2
                            </option>
                            <option value="S2+"
                                    <c:if test="${pd.overdueStage=='S2+'}">selected</c:if>>S2+
                            </option>
                            <option value="M1"
                                    <c:if test="${pd.overdueStage=='M1'}">selected</c:if>>M1
                            </option>
                            <option value="M2"
                                    <c:if test="${pd.overdueStage=='M2'}">selected</c:if>>M2
                            </option>
                            <option value="M3"
                                    <c:if test="${pd.overdueStage=='M3'}">selected</c:if>>M3
                            </option>
                            <option value="M3+"
                                    <c:if test="${pd.overdueStage=='M3+'}">selected</c:if>>M3+
                            </option>
                        </select>
                    </div>
                </td>
                <td>
                    <div class="pull-left search " style="text-align: center;margin-left: 20px;">
                        逾期天数:
                        <input autocomplete="off" type="text" id="minOverdueDate" class="form-control divcss5"
                               name="minOverdueDate"
                               value="${pd.minOverdueDate}" checkNumber
                               style="font-size: 14px;padding: 4px 6px;color: #000;width: 100px;">至
                        <input autocomplete="off" type="text"
                               id="maxOverdueDate"
                               class="form-control divcss5"
                               name="maxOverdueDate"
                               value="${pd.maxOverdueDate}"
                               checkNumber style="font-size: 14px;padding: 4px 6px;color: #000;width: 100px;">
                    </div>
                </td>
                <td>
                    <div class="pull-left search " style="text-align: center;margin-left: 20px;">
                        金&emsp;&emsp;额:
                        <input autocomplete="off" type="text" id="minReceveMoney" class="form-control divcss5"
                               name="minReceveMoney" value="${pd.minReceveMoney}"
                               style="font-size: 14px;padding: 4px 6px;color: #000;width: 100px;">至
                        <input autocomplete="off" type="text" id="maxReceveMoney" class="form-control divcss5"
                               name="maxReceveMoney" value="${pd.maxReceveMoney}"
                               style="font-size: 14px;padding: 4px 6px;color: #000;width: 100px;">
                    </div>

                </td>
               <%--  <td>
                    <div class="pull-left search " style="text-align: center;margin-left: 20px;">
                        累计还款:
                        <input autocomplete="off" type="text" id="minReceveAmount" class="form-control divcss5"
                               name="minReceveAmount" value="${pd.minReceveAmount}"
                               style="font-size: 14px;padding: 4px 6px;color: #000;width: 100px;">至
                        <input autocomplete="off" type="text" id="maxReceveAmount" class="form-control divcss5"
                               name="maxReceveAmount" value="${pd.maxReceveAmount}"
                               style="font-size: 14px;padding: 4px 6px;color: #000;width: 100px;">
                    </div>

                </td> --%>
                <td>
                    <div class="pull-left search " style="text-align: center;margin-left: 20px;">
                        未还罚息:
                        <input autocomplete="off" type="text" id="minOverdueFee" name="minOverdueFee"
                               class="form-control divcss5" value="${pd.minOverdueFee}"
                               style="font-size: 14px;padding: 4px 6px;color: #000;width: 100px;">至
                        <input autocomplete="off" type="text" id="maxOverdueFee" name="maxOverdueFee"
                               class="form-control divcss5" value="${pd.maxOverdueFee}"
                               style="font-size: 14px;padding: 4px 6px;color: #000;width: 100px;">
                    </div>

                </td>
            </tr>
            <tr>
                <td>
                    <div class="pull-left search " style="text-align: center;margin-left: 20px;">
                        催收组:&nbsp;&nbsp;&nbsp;
                        <select id="overdueDuration" class="chzn-select form-control" name="overdueDuration"
                                data-placeholder="不限"
                                style="font-size: 14px;padding: 2px 3px;color: #000;width: 100px;">
                            <option value=""></option>
                            <option value="">请选择催收组</option>
                            <option value="C-M1"
                                    <c:if test="${pd.overdueDuration=='C-M1'}">selected</c:if>>C~M1
                            </option>
                            <option value="M1-M2"
                                    <c:if test="${pd.overdueDuration=='M1-M2'}">selected</c:if>>M1~M2
                            </option>
                            <option value="M2-M3"
                                    <c:if test="${pd.overdueDuration=='M2-M3'}">selected</c:if>>M2~M3
                            </option>
                            <option value="M3+"
                                    <c:if test="${pd.overdueDuration=='M3+'}">selected</c:if>>M3+
                            </option>
                            <option value="S1"
                                    <c:if test="${pd.overdueDuration=='S1'}">selected</c:if>>S1
                            </option>
                            <option value="S2"
                                    <c:if test="${pd.overdueDuration=='S2'}">selected</c:if>>S2
                            </option>
                            <option value="S2+"
                                    <c:if test="${pd.overdueDuration=='S2+'}">selected</c:if>>S2+
                            </option>
                        </select>
                    </div>
                </td>
                <td>
                    <div class="pull-left search " style="text-align: center;margin-left: 20px;margin-top: 10px">
                        催收员:
                        <input autocomplete="off" type="text" id="userName" name="userName"
                               class="form-control divcss5"
                               value="${pd.userName }"
                               style="font-size: 14px;padding: 4px 6px;color: #000;width: 70px;">
                    </div>
                    <div class="pull-left search " style="text-align: center;margin-left: 20px;margin-top: 10px">
                        催收状态:
                        <%--status的状态号--%>
                        <input type="hidden" id="selValStatus"/>
                        <%--StatusType状态--%>
                        <input type="hidden" id="selValStatusType"/>
                        <select id="status" class="form-control" name="status" data-placeholder="不限"
                                style="font-size: 14px;padding: 2px 3px;color: #000;width: 90px">
                            <option value="">不限</option>
                            <option value="0" class="c_no"
                                    <c:if test="${pd.status=='0'}">selected='selected'</c:if>>待催收
                            </option>
                            <option value="1" class="c_no"
                                    <c:if test="${pd.status=='1'}">selected='selected'</c:if>>催收中
                            </option>
                            <option value="2" class="c_no"
                                    <c:if test="${pd.status=='2'}">selected='selected'</c:if>>已结案
                            </option>
                            <option value="5" class="c_yes"
                                    <c:if test="${pd.status=='5'}">selected='selected'</c:if>>委外待催收
                            </option>
                            <option value="3" class="c_yes"
                                    <c:if test="${pd.status=='3'}">selected='selected'</c:if>>委外催收中
                            </option>
                            <option value="4" class="c_yes"
                                    <c:if test="${pd.status=='4'}">selected='selected'</c:if>>委外已结案
                            </option>
                        </select>
                    </div>
                </td>
                <td>
                    <div class="pull-left search " style="text-align: center;margin-left: 20px; margin-top: 9px">
                        催收结果:
                        <select id="callResult" class="chzn-select form-control" name="callResult"
                                data-placeholder="不限"
                                style="font-size: 14px;padding: 2px 3px;color: #000;width: 80px">
                            <option value="">不限</option>
                            <c:forEach var="callResult" items="${callresulttypef}" varStatus="var">
                                <option value="${callResult.key}"
                                        <c:if test="${pd.callResult eq callResult.key}">selected='selected'</c:if>>${callResult.value}</option>
                            </c:forEach>
                        </select>
                    </div>
                    <div class="pull-left search " style="text-align: center;margin-left: 20px;margin-top: 6px">
                        是否委外:
                        <select
                                class="form-control" id="statusType" name="statusType"
                                data-placeholder="不限"
                                style="font-size: 14px;padding: 2px 3px;color: #000;width: 80px;"
                                onchange="selectValueStatusType()">
                            <option value="">不限</option>
                            <option value="0" class="abc"
                                    <c:if test="${pd.statusType=='0'}">selected</c:if>>否
                            </option>
                            <option value="1" class="efg"
                                    <c:if test="${pd.statusType=='1'}">selected</c:if>>是
                            </option>
                        </select>
                    </div>
                </td>
            </tr>
        </table>
        <div class="pull-left" style="margin-left: 20px;">自定义项:
            <input autocomplete="off" type="text" id="telephone" name="telephone" placeholder="手机号（本人）"
                   class="form-control divcss5"
                   value="${pd.telephone}" style="font-size: 14px;padding: 4px 6px;color: #000;width: 100px;"/>
        </div>
        <div class="pull-left search" style="margin-left: 10px;">
            <input autocomplete="off" type="text" id="contIdCard" class="form-control divcss5"
                   placeholder="借款人身份证号"
                   name="contIdCard"
                   value="${pd.contIdCard}"
                   style="font-size: 14px;padding: 4px 6px;color: #000;width: 100px;"/>
        </div>

        <div class="pull-left search" style="margin-left: 10px;">
            <input autocomplete="off" type="text" id="realName" class="form-control divcss5"
                   placeholder="借款人姓名"
                   name="realName"
                   value="${pd.realName}"
                   style="font-size: 14px;padding: 4px 6px;color: #000;width: 100px;"/>
        </div>
        <div class="pull-left search" style="margin-left: 10px;">
            <input autocomplete="off" id="borrowNid" type="text" class="form-control divcss5 "
                   placeholder="借款编号"
                   name="borrowNid" value="${pd.borrowNid }"
                   style="font-size: 14px;padding: 4px 6px;color: #000;width: 100px;"/>
        </div>
        <div class="pull-left search" style="margin-left: 10px;">
            <input autocomplete="off" id="callLoanNid" type="text" class="form-control divcss5 "
                   placeholder="催收编号"
                   name="callLoanNid" value="${pd.callLoanNid }"
                   style="font-size: 14px;padding: 4px 6px;color: #000;width: 100px;"/>
        </div>
        <div class="pull-left search" style="margin-left: 10px;">
            <input autocomplete="off" type="text" id="province" name="province"
                   placeholder="客户户籍"
                   class="form-control divcss5"
                   value="${pd.province}" style="font-size: 14px;padding: 4px 6px;color: #000;width: 100px;"/>
        </div>
        <div class="pull-left search" style="margin-left: 10px;">
            <input autocomplete="off" type="text" id="repaymentId" name="repaymentId"
                   placeholder="还款订单号"
                   class="form-control divcss5"
                   value="${pd.repaymentId}" style="font-size: 14px;padding: 4px 6px;color: #000;width: 100px;"/>
        </div>
        <!-- ==================按钮============================ -->
        <div style="width:750px ; margin-left: 20px;">
            <label class="btn btn-primary btn-small" id="searchList">查询</label>
            <script type="text/javascript">
                //提交表单
                $("#searchList").click(function () {
                    
                    $("#sortbylasttime1").val("");
                    
                   if(
	                	$("[name='productSource']").val()||
	                    $("[name='overdueStage']").val()||
	                    $("[name='callLoanNid']").val()||
	                    $("[name='borrowNid']").val()||
	                    $("[name='repaymentId']").val()||
	                    $("[name='province']").val()||
	                    $("[name='contIdCard']").val()||
	                    $("[name='realName']").val()||
	                    $("[name='minReceveMoney']").val()||
	                    $("[name='maxReceveMoney']").val()||
	                    $("[name='minOverdueDate']").val()||
	                    $("[name='maxOverdueDate']").val()||
	                    $("[name='userName']").val()||
	                    $("[name='minCreateTime']").val()||
	                    $("[name='maxCreateTime']").val()||
	                    $("[name='minOverdueFee']").val()||
	                    $("[name='maxOverdueFee']").val()||
	                    $("[name='minEndCaseDateOver']").val()||
	                    $("[name='maxEndCaseDateOver']").val()||
	                    $("[name='telephone']").val()||
	                    $("[name='minCallTime']").val()||
	                    $("[name='maxCallTime']").val()||
	                    $("[name='overdueDuration']").val()||
	                    $("[name='status']").val()||
	                    $("[name='callResult']").val()||
	                    $("[name='statusType']").val())
                    {
                	   $("#pageForm").checkNumber();
                    } else {
                    	var index = layer.load();
                        layer.msg("请选择需要查询的数据", {
                            icon: 5,
                            time: 2000
                        });
                        layer.close(index);
                    }
                })

            </script>
            <label id="doEmpty" class="btn btn-primary btn-small">清空</label>
        </div>
        <!-- ==================按钮============================ -->
        <br><br><br>
        <!-- 高级查询=============================================================== -->
        <table id="table_report" class="table table-bordered table-hover" style="margin-left: 20px;margin-top: -30px;">
            <input type="hidden" id="sortbylasttime1" name="sortbylasttime" value="${pd.sortbylasttime }">
            <thead>
            <tr>
                <th align="center"><input id="checkAll"
                                          name="quanx" type="checkbox" style="position:relative;opacity:100;"/></th>
                <th>催收编号</th>

                <!-- <th>借款编号</th>
                <th>手机号</th>
                <th>借款人身份证</th> -->
                <th>借款人姓名</th>
                <th>金额</th>
                <th>逾期期数</th>
                <th>
                    <button id="lastcalltime" onclick="gensortbylasttime('${sortbylasttime}');">最后催收时间</button>
                </th>
                <th>催收状态</th>
                <th>催收结果</th>

                <th>催收组</th>
                <th>逾期天数</th>
                <th>催收员</th>
                <th>是否委外</th>
                
                <th>逾期阶段</th>
                <th>入案时间</th>
                <th>结案时间</th>
                <th>分派时间</th>
                <th>还款订单号</th>
            </tr>
            </thead>
            <tbody>
            <!-- 开始循环 -->
            <c:choose>
                <c:when test="${not empty pagelist}">
                    <c:forEach items="${pagelist }" var="var" varStatus="vs">
                        <!-- 复选框 -->
                        <td align="center"><input id="${var.call_loan_nid}"
                                                  value="${var.call_mark}" name="subBox" type="checkbox"
                                                  style="position:relative;opacity:100;">
                        </td>
                        <!-- 催收编号 -->
                        <td><%--<a href="javascript:void(-1);" style="color: blue"
                                   onclick="toDetail('${var.call_loan_nid}','${var.user_id}','${var.repayment_id}')">--%>${var.call_loan_nid}<%--</a>--%>
                        </td>
                        <%-- <td>${var.call_loan_nid}</td> --%>

                        <%-- <td>${var.borrow_nid}</td>
                        <td>${var.telephone }</td>
                        <td>${var.cont_id_card}</td> --%>
                        <td>${var.real_name}</td>
                        <td> ${var.receveMoney}</td>
                        <td>${var.period }/${var.period_total }</td>
                        <td>
                            <fmt:formatDate value="${var.last_call_time}" pattern="yyyy-MM-dd HH:mm:ss"/>
                        </td>
                        <td>
                            <c:choose>
                                <c:when test="${var.status=='0'}">
                                    <span>待催收</span>
                                </c:when>
                                <c:when test="${var.status=='1'}">
                                    <span>催收中</span>
                                </c:when>
                                <c:when test="${var.status=='2'}">
                                    <span>已结案</span>
                                </c:when>
                                <c:when test="${var.status=='5'}">
                                    <span>委外待催收</span>
                                </c:when>
                                <c:when test="${var.status=='3'}">
                                    <span>委外催收中</span>
                                </c:when>
                                <c:when test="${var.status=='4'}">
                                    <span>委外已结案</span>
                                </c:when>
                            </c:choose>
                        </td>
                        <%--催收结果--%>
                        <td>
                            <c:forEach var="callResult" items="${callresulttypef}">
                                <c:if test="${callResult.key eq var.call_result}">
                                    ${callResult.value}
                                </c:if>
                            </c:forEach>
                        </td>
                        <td>${var.overdue_duration}</td>
                        <td>${var.overdue_date}</td>
                        <td>${var.username}</td>
                        <td>
                            <c:choose>
                                <c:when test="${var.status=='0' || var.status=='1' || var.status=='2'}">
                                    <span>否</span>
                                </c:when>
                                <c:when test="${var.status=='3' || var.status=='4' || var.status=='5'}">
                                    <span>是</span>
                                </c:when>
                            </c:choose>
                        </td>
                        <td>${var.overdue_stage }</td>
                        <td><fmt:formatDate value="${var.create_time }"
                                            pattern="yyyy-MM-dd HH:mm:ss"/>
                        </td>
                        <td><fmt:formatDate value="${var.end_case_date }"
                                            pattern="yyyy-MM-dd HH:mm:ss"/>
                        </td>
                        <td><fmt:formatDate value="${var.call_time }"
                                            pattern="yyyy-MM-dd HH:mm:ss"/>
                        </td>
                        <td>${var.repayment_id}</td>
                        </tr>
                    </c:forEach>
                </c:when>
                <c:otherwise>
                    <tr class="main_info">
                        <td colspan="100" class="center">没有相关数据</td>
                    </tr>
                </c:otherwise>
            </c:choose>
            </tbody>
        </table>
        <div class="page-header position-relative">
            <span>${countMoney}</span>
            <table style="width: 100%;">
                <tr>
                    <td style="vertical-align: top;">
                        <div class="pagination"
                             style="float: right; padding-top: 0px; margin-top: 0px;">${page.pageStr}
                        </div>
                    </td>
                </tr>
            </table>
        </div>
    </form>
</div>
</div>
<!-- 引入 -->
<script type="text/javascript">
    window.jQuery
    || document
        .write("<script src='static/js/jquery-1.9.1.min.js'>\x3C/script>");
</script>
<script src="static/js/bootstrap.min.js"></script>
<script src="static/js/ace-elements.min.js"></script>
<script src="static/js/ace.min.js"></script>
<script type="text/javascript" src="static/js/chosen.jquery.min.js"></script>
<script type="text/javascript"
        src="static/js/bootstrap-datepicker.min.js"></script>
<script type="text/javascript" src="static/js/bootbox.min.js"></script>
<script type="text/javascript" src="static/js/jquery.tips.js"></script>
<script type="text/javascript">
    function set1(key, value) {
        window.localStorage[key] = value;
    }

    function clearSelect(id) {
        $(id + " option").removeAttr("selected");
        $(id + "_chzn a span").html("不限");
        //search();
    }

    function doEmpty() {
        $("#doEmpty").click(function () {
            $(".efg").removeAttr("disabled");
            $(".abc").removeAttr("disabled");
            $(".c_no").removeAttr("disabled");
            $(".c_yes").removeAttr("disabled");
            $("[name='callLoanNid']").val("")
            $("[name='borrowNid']").val("")
            $("[name='repaymentId']").val("")
            $("[name='province']").val("")
            $("[name='contIdCard']").val("")
            $("[name='realName']").val("")
            $("[name='minReceveMoney']").val("")
            $("[name='maxReceveMoney']").val("")
            $("[name='minOverdueDate']").val("")
            $("[name='maxOverdueDate']").val("")
            $("[name='userName']").val("")
            $("[name='minCreateTime']").val("")
            $("[name='maxCreateTime']").val("")
            $("[name='minOverdueFee']").val("")
            $("[name='maxOverdueFee']").val("")
            $("[name='minEndCaseDateOver']").val("")
            $("[name='maxEndCaseDateOver']").val("")
            $("[name='telephone']").val("")
            $("[name='minCallTime']").val("")
            $("[name='maxCallTime']").val("")
            $("[name='']").val("")
            $("#sortbylasttime1").val("");
            $("#productSourceId").val("");
            clearSelect("#productSource");
            clearSelect("#status");
            clearSelect("#callResult");
            clearSelect("#overdueDuration");
            clearSelect("#statusType");
            clearSelect("#overdueStage");
        });
    }
</script>
<script type="text/javascript">
    $(function () {
        /*状态*/
        $("#status").change(function () {
            var val = $("#status").val();
            if (val == '1' || val == '2' || val == '0') {
                $(".efg").attr("disabled", "disabled");
                $(".abc").removeAttr("disabled");
            } else if (val == '3' || val == '4' || val == '5') {
                $(".abc").attr("disabled", "disabled");
                $(".efg").removeAttr("disabled");
            } else {
                $(".efg").removeAttr("disabled");
                $(".abc").removeAttr("disabled");
            }
        });
        statusFun();
        /*是否委外*/
        $("#statusType").change(function () {
            var val = $("#statusType").val();
            if (val == '0') {
                $(".c_yes").attr("disabled", "disabled");
                $(".c_no").removeAttr("disabled");
            } else if (val == '1') {
                $(".c_no").attr("disabled", "disabled");
                $(".c_yes").removeAttr("disabled");
            } else {
                $(".c_no").removeAttr("disabled");
                $(".c_yes").removeAttr("disabled");
            }
        });
        statusTypeFun();
    });

    function statusFun(){
        var pdstat ='${pd.status}';
        if(!pdstat) return;
        if (pdstat == '0' || pdstat == "1" || pdstat == '2') {
            $(".efg").attr("disabled", "disabled");
            $(".abc").removeAttr("disabled");
        } else if (pdstat == '3' || pdstat == '4' || pdstat == '5') {
            $(".abc").attr("disabled", "disabled");
            $(".efg").removeAttr("disabled");
        } else {
            $(".efg").removeAttr("disabled");
            $(".abc").removeAttr("disabled");
        }
    }
    function statusTypeFun(){
        var statusType ='${pd.statusType}';
        if(!statusType) return;
        if (statusType == '0') {
            $(".c_yes").attr("disabled", "disabled");
            $(".c_no").removeAttr("disabled");
        } else if (statusType== '1') {
            $(".c_no").attr("disabled", "disabled");
            $(".c_yes").removeAttr("disabled");
        } else {
            $(".c_no").removeAttr("disabled");
            $(".c_yes").removeAttr("disabled");
        }
    }
</script>
<script type="text/javascript">


    /* 下拉框 */
    $(top.hangge());

    //检索
    function search() {
        top.jzts();
        $("#pageForm").submit();
    }


    $(function () {
        //单选框
        $(".chzn-select").chosen();
        $(".chzn-select-deselect").chosen({
            allow_single_deselect: true
        });
        //日期框
        $('.date-picker').datepicker();
        doEmpty();
    });

    /* 全选 */
    $(function () {
        $("#checkAll").click(function () {
            $('input[name="subBox"]').prop("checked", this.checked);
        });
        var $subBox = $("input[name='subBox']");
        $subBox
            .click(function () {
                $("#checkAll")
                    .prop(
                        "checked",
                        $subBox.length == $("input[name='subBox']:checked").length ? true
                            : false);
            });
    });
    function gensortbylasttime(a){
        if (a == 1) {
            $("#sortbylasttime1").val("0")
        } else {
            $("#sortbylasttime1").val("1")
        }
        $("#pageForm").submit();
    }
</script>
</body>
</html>

